export default [
  {
    path: "/system",
    name: "System",
    meta: {title: "系统管理",icon: 'setting'},
    hidden:false,
    flag:1,  // 不显示当前菜单，但显示子菜单
    redirect: '/system/farm',
    children:[
      {
        path: 'farm',
        name: 'System-Farm',
        hidden:false,
        meta: {title: '农场管理',icon: 'officeBuilding', keepAlive: true},
        redirect: '/system/farm/list',
        children:[
          {
            path: 'list',
            name: 'System-Farm-List',
            hidden:false,
            meta: {title: '农场列表',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/farm/index.vue'),
          },
          {
            path: 'add',
            name: 'System-Farm-Add',
            hidden:true,
            meta: {title: '新增农场',icon: 'officeBuilding', keepAlive: true},
            component: () => import('@/view/system/farm/add.vue'),
            beforeEnter: (to, from, next) => {
              if(to.query.id){
                to.meta.title = '编辑农场'
              }
              next()
            }
          }
        ]
      },
      {
        path: 'team',
        name: 'System-Team',
        hidden:false,
        meta: {title: '团队管理',icon: 'Guide', keepAlive: true},
        //component: () => import('@/view/system/team/index.vue'),
        children:[
          {
            path: 'list',
            name: 'System-Team-List',
            hidden:false,
            meta: {title: '团队列表',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/team/index.vue'),
          },
          // {
          //   path: 'add',
          //   name: 'System-Team-Add',
          //   hidden:true,
          //   meta: {title: '新增团队',icon: 'officeBuilding', keepAlive: true},
          //   component: () => import('@/view/system/team/add.vue'),
          // }
        ]
      },
      {
        path: 'account',
        name: 'System-Account',
        hidden:false,
        meta: {title: '账户管理',icon: 'User', keepAlive: true},
        //component: () => import('@/view/system/account/index.vue'),
        children:[
          {
            path: 'list',
            name: 'System-Account-List',
            hidden:false,
            meta: {title: '账户列表',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/account/index.vue'),
          },
          // {
          //   path: 'add',
          //   name: 'System-Account-Add',
          //   hidden:true,
          //   meta: {title: '新增账户',icon: 'officeBuilding', keepAlive: true},
          //   component: () => import('@/view/system/account/add.vue'),
          // }
        ]
      },
      {
        path: 'role',
        name: 'System-Role',
        hidden:false,
        onlyShows:[1], // 仅在角色id为1的时候显示（即平台管理人员）
        meta: {title: '角色管理',icon: 'Lock', keepAlive: true},
        //component: () => import('@/view/system/role/index.vue'),
        children:[
          {
            path: 'list',
            name: 'System-Role-List',
            hidden:false,
            meta: {title: '角色列表',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/role/index.vue'),
          },
          // {
          //   path: 'add',
          //   name: 'System-Role-Add',
          //   hidden:true,
          //   meta: {title: '新增角色',icon: 'officeBuilding', keepAlive: true},
          //   component: () => import('@/view/system/role/add.vue'),
          // }
        ]
      },
      {
        path: 'message',
        name: 'System-Message',
        hidden:false,
        onlyShows:[1], // 仅在角色id为1的时候显示（即平台管理人员）
        meta: {title: '消息管理',icon: 'Bell', keepAlive: true},
        children:[
          {
            path: 'list',
            name: 'System-Message-List',
            hidden:false,
            meta: {title: '消息列表',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/message/index.vue'),
          },
          {
            path: 'add',
            name: 'System-Message-Add',
            hidden:true,
            meta: {title: '新增消息',icon: 'Bell', keepAlive: true},
            component: () => import('@/view/system/message/add.vue'),
            beforeEnter: (to, from, next) => {
              if(to.query.id){
                to.meta.title = '编辑消息'
              }
              next()
            }
          },
          {
            path: 'details',
            name: 'System-Message-Details',
            hidden:true,
            meta: {title: '消息详情',icon: 'Bell', keepAlive: true},
            component: () => import('@/view/system/message/details.vue'),
          }
        ]
      },
      {
        path: 'opinion',
        name: 'System-Opinion',
        hidden:false,
        onlyShows:[1], // 仅在角色id为1的时候显示（即平台管理人员）
        meta: {title: '意见反馈',icon: 'QuestionFilled', keepAlive: true},
        children:[
          {
            path: 'list',
            name: 'System-Opinion-List',
            hidden:false,
            meta: {title: '问题与建议',icon: 'List', keepAlive: true},
            component: () => import('@/view/system/opinion/index.vue'),
          },
          {
            path: 'detail',
            name: 'System-Opinion-Detail',
            hidden:true,
            meta: {title: '意见反馈详情',icon: 'officeBuilding', keepAlive: true},
            component: () => import('@/view/system/opinion/detail.vue'),
          }
        ]
      },
    ]
  }
] 